package com.echat.business.book.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.echat.business.home.model.SysUser;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 书籍评论表
 * </p>
 *
 * @author chentl123
 * @since 2019-05-28
 */
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
@TableName("echo_business_discussion")
public class Discussion extends Model<Discussion>  {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 对应 echo_business_book 表中的 id
     */
    private Integer bookId;
    /**
     * 评论内容
     */
    private String content;
    /**
     * 评论发布时间
     */
    private Date createTime;
    /**
     * 删除标记
     */
    private Integer delflag;
    /**
     * 发表评论的 用户id，对应 sys_user 中的id
     */
    private Integer userId;
    /**
     * 评论下的回复列表
     */
    @TableField(exist = false)
    private List<DiscussionReply> replys;
    /**
     * 人员信息
     */
    @TableField(exist = false)
    private SysUser discussUser;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getDelflag() {
        return delflag;
    }

    public void setDelflag(Integer delflag) {
        this.delflag = delflag;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public List<DiscussionReply> getReplys() {
        return replys;
    }

    public void setReplys(List<DiscussionReply> replys) {
        this.replys = replys;
    }

    public SysUser getDiscussUser() {
        return discussUser;
    }

    public void setDiscussUser(SysUser discussUser) {
        this.discussUser = discussUser;
    }

    @Override
    public String toString() {
        return "Discussion{" +
                "id=" + id +
                ", bookId=" + bookId +
                ", content='" + content + '\'' +
                ", createTime=" + createTime +
                ", delflag=" + delflag +
                ", userId=" + userId +
                ", replys=" + replys +
                ", discussUser=" + discussUser +
                '}';
    }

    @Override
    protected Serializable pkVal() {
        return null;
    }
}
